package com.shuaiche.yeguan.ui.map;

import android.content.Context;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseViewHolder;
import com.shuaiche.yeguan.R;
import com.shuaiche.yeguan.model.ChangeLocation;
import com.shuaiche.yeguan.base.SCBaseQuickAdapter;

import java.util.List;

public class SearchNearByAddressAdapter extends SCBaseQuickAdapter<ChangeLocation> {
    private Context context;

    public SearchNearByAddressAdapter(Context context, List<ChangeLocation> data) {
        super(context, R.layout.search_near_by_item, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, ChangeLocation changeLocation) {
//        baseViewHolder.setText(R.id.tv_search_poi_address_item, changeLocation.getAddress());
        baseViewHolder.setText(R.id.tv_search_poi_title_item, changeLocation.getName());
        ImageView imageView = baseViewHolder.getView(R.id.item_icon);
        if (changeLocation.isFirstItem()) {
            imageView.setImageResource(R.mipmap.icon_map_marker);
        } else {
            imageView.setImageResource(R.mipmap.icon_hand_location);
        }

    }
}
